<?php
namespace Cyfy\Modules\QuickLinks\Forms;
use \Cyfy\Message;
use \Cyfy\Modules\Forms;

/**
 * Editing quick link
 */
class Edit extends Create
{
	function submit()
	{  
        $this -> onSubmit = "Cyfy.ajax('QuickLinks', 'list', '#AdminListOfQuickLinks', ''); $('#AdminEditQuickLink').slideUp('fast', function(){ $(this).html('')}); Blocks.reload('QuickLinks', '" . $this->get("code")."');";
		if(\dibi :: query("UPDATE [:cyfy:QuickLinks] SET %a", $this -> getAll(), " WHERE [qid] = %i", $this -> getTemp('qid')));
        {
			\Cyfy\Message :: set(self :: t(221, array($this->get("name"))));
            // update blocks
            \Cyfy\Blocks :: updateBlock('QuickLinks', $this -> getTemp("oldCode"), $this->get("code"));
            return true;     
		}	
	}	
}
